public class test5 {
    public static void main(String[] args) {
        //计算营业额
        //第一季度
        //第二季度
        //第三季度
        //第四季度

        //创建二维数组并赋值
        int[][] Yeararrarr = {
                {22, 66, 44},
                {77, 33, 88},
                {25, 45, 65},
                {11, 66, 99},
        };
        int YearSum = 0;
        for (int i = 0; i < Yeararrarr.length; i++) {
            int sum = 0;
            int[] quartetarr = Yeararrarr[i];
            sum = GetSum(quartetarr);
            YearSum = YearSum + sum;
            System.out.println("第" + (i + 1) + "个季度的营业额为" + sum);
        }
        System.out.println("全年总营业额为" + YearSum);
    }

    public static int GetSum(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum = sum + arr[i];
        }
        return sum;
    }
}
